<?php
global $tpl;
date_default_timezone_set("Asia/Saigon");

switch($_GET['act'])
{			
	case 'register':
		$tpl = 'register';
		break;
		
	case 'registersm':
		Register();
		$tpl = 'list';
		break;
			
	case 'login':	
		//CheckBaoTri();
		$tpl = 'login';		
		break;
		
	case 'loginsm':
		Login();		
		$tpl = 'list';
		break;
	case 'napthe':	
		CheckLoginGame();
		$tpl = 'napthe';		
		break;
		
	case 'napthesm':
		CheckLoginGame();
		NapThe();		
		$tpl = 'list';
		break;	
		
	case 'logout':
		Logout();
		$tpl = 'list';
		break;
		
	case 'checkinfo':
		CheckInfo();
		$tpl = 'checkinfo';
		break;
		
	case 'giaodich':
		GiaoDich();
		$tpl = 'giaodich';
		break;	
		
	case 'thaydoi':
		//GiaoDich();
		$tpl = 'thaydoi';
		break;
		
	case 'thaydoism':
		ThayDoiSM();
		$tpl = 'list';
		break;	
		
	case 'test':
		Test();
		$tpl = 'list';
		break;
	
	case 'test':
		Test();
		$tpl = 'list';
		break;	
		
	case 'updatepassword':
		UpdatePassword();
		//$tpl = 'list';
		break;	
		
	case 'p-baotri':
		BaoTri();
		$tpl = 'list';
		break;
		
	case 'baotri':
		$tpl = 'baotri';
		break;	
	
	case 'giftcode':
		$tpl = 'giftcode';
		break;		
	
	case 'giftcodesm':
		SendEmail();
		$tpl = 'list';
		break;	
		
	case 'giftlvl':
		$tpl = 'giftlvl';
		GiftLvlLoad();
		break;											
			
	default:
		CheckLoginGame();
		$tpl = 'list';		
		break;
}
function GiftLvlLoad()
{
	include("./includes/config.php");	
	global $notice, $database, $database2, $db, $arr, $userPlayer;
	$sql = "SELECT * FROM `player`, playerbattle as pb WHERE pb.playerId = player.playerId and player.userName = '".$_COOKIE['username']."'";
	$userPlayer = $db->getRow($sql);	
}
function UpdatePassword()
{
	include("./includes/config.php");	
	global $notice, $database, $database2, $db, $arr;
	
	$sql = "select *from `account`";
	$arr = $db->getAll($sql);
	//print_r($arr);
	for($i = 0; $i < count($arr); $i++)
	{
		$password_new = md5($arr[$i]['password_hash']);	
		//echo $password_new;
		$arr2['password_md5'] = $password_new;
		//echo $arr[$i]["id"];
		vaUpdatedebug("account",$arr2," `id` = '".$arr[$i]["id"]."'");
		//break;
	}
}
function BaoTri()
{
	setcookie("baotri","1",time() + 3600);	
}
function ThayDoiSM()
{
	include("./includes/config.php");	
	global $notice, $database, $database2, $db, $arr;	
	
	$username = $_COOKIE['username'];
	$password=CleanSQLInjection($_POST['password']);
	$password_new=CleanSQLInjection($_POST['password_new']);
	$password_new2=CleanSQLInjection($_POST['password_new2']);
	
	$key=substr($_SESSION['key'],0,4);
	$number = $_REQUEST['number_captcha'];
	
	if($number==$key && $number != ''){
	
	
	
	if($password_new == $password_new2 && $password != "" && $password_new != "")
	{
		$check=$db->getRow("Select * from account where id = '$username'");
		
		if(count($check) >= 1 && $username != '' && $check['password_hash'] == $password)
		{		
			$sql = "UPDATE  account SET  password_hash =  '$password_new' WHERE  id =  '$username'";
			//$sql2 = "UPDATE  player SET  password =  '$password_new' WHERE  userName =  '$username'";
			
			//echo $sql."<br/>";
			//echo $sql2;
			$db->getRow($sql);
			//$db->getRow($sql2);		
			
			//$db->db_select_db("daokiemvotinh2") || die("Could not connect to SQL db");
			
			//$db->getRow($sql);
			//$db->getRow($sql2);	
			
			$notice="Tài khoản $username thay đổi password thành công.";
			//header('Location: login.php');				
			
		}
		else
		{
			$notice = "Thay đổi mật khẩu thất bại";
		}
		if(count($check) == 0)
		{
			$notice="Tài khoản $username không tồn tại.";
		}
		}
		else
		{
			$notice = "Thay đổi mật khẩu thất bại";
		}
	
	}

}
function GiaoDich()
{
	include("./includes/config.php");	
	global $notice, $database, $database2, $db, $arr;	
	
	$username = $_COOKIE['username'];
	$sql = "select *from chongzhi where userName = '".$username."'";
	//echo $sql;
	$arr = $db->getAll($sql);	
}
function CheckInfo()
{
	include("./includes/config.php");
	global $notice, $database, $database2, $db, $arr;	
	
	$username = $_COOKIE['username'];
	$sql = "select *from account where id = '".$username."'";
	//echo $sql;
	$arr = $db->getRow($sql);	
}
function Register2()
{
	global $notice, $database, $database2;
	include("./config.php");
	$key=substr($_SESSION['key'],0,4);
	$number = $_REQUEST['number_captcha'];
	
	if($number==$key && $number != ''){
	
		$username=CleanSQLInjection($_POST['username']);
		$password=CleanSQLInjection($_POST['password']);
		$repeat=CleanSQLInjection($_POST['repassword']);
		$mail=$_POST['email'];
		$cmnd=$_POST['cmnd'];
		if(isset($_POST['reg']))
		{
			if($password == $repeat and $password != "" and $mail != "")
			{
				$check=mysql_query("Select * from account where id = '$username'");
				if(mysql_num_rows($check) == 0)
				{
					$check2=mysql_query("Select * from account where email = '$mail'");
					if(mysql_num_rows($check2) == 0)
					{
						$sql = "INSERT INTO account (id,password,email, cmnd, password_hash) VALUES ('$username','$password','$mail', '$cmnd', '$password')";
						mysql_query($sql);
						
						mysql_select_db($database2);						
						mysql_query($sql);
						mysql_select_db($database);	
						
						$notice="Đăng ký thành công. Vui lòng đăng nhập.";
						header('Location: index.php?do=player');
					}
					
					if(mysql_num_rows($check2) >= 1)
					{
						$notice="Email $mail đã được sử dụng";
					} 
				}
				if(mysql_num_rows($check) >= 1)
				{
					$notice="Tài khoản $username đã tồn tại";
				}
			}
			else
			{
				$notice="Thông tin bạn nhập chưa chính xác, đầy đủ $username";
			}
		}
	}
	else
	{
		$notice="Mã xác nhận không đúng, vui lòng đăng ký lại.";
	}
}
function Register()
{
	global $notice, $database, $database2, $arr, $db;
	include("./includes/config.php");
	
	$key=substr($_SESSION['key'],0,4);
	$number = $_REQUEST['number_captcha'];
	
	if($number==$key && $number != ''){
	
		$username=CleanSQLInjection($_POST['username']);
		$password=CleanSQLInjection($_POST['password']);
		$repeat=CleanSQLInjection($_POST['repassword']);
		$email=$_POST['email'];
		$cmnd=$_POST['cmnd'];
		if(isset($_POST['reg']))
		{
			if($password == $repeat and $password != "" and $email != "")
			{
				//Check Email
				if(validEmail($email))
				{
					$sql ="select * from account where `id` = '$username'";				
					$user = $db->getRow($sql);
					
					if($user)
					{
						$notice="Tài khoản $username đã tồn tại.";
					}
					else
					{
						$sql ="Select * from account where email = '$email'";		
						$check2 = $db->getRow($sql);
						if($check2)
						{
							$notice="Email $mail đã được sử dụng.";
							
						}
						else
						{
							$arr['id'] = $username;
							$arr['password'] = md5($password);
							$arr['email'] = $email;
							$arr['cmnd'] = $cmnd;
							$arr['password_hash'] = $password;
							$arr['password_md5'] = $password;
							$arr['ip_login_last'] = getRealIPAddress();
							$arr['time_login_last'] = date("Y-m-d H:i:s");
							
							vaInsert("account", $arr);
							
							$notice="Đăng ký thành công. Vui lòng đăng nhập.";
							header('Location: index.php?do=player');
						}
					}
				}
				else
				{
					$notice="Email: $email của bạn chưa chính xác.";
				}
			}
			else
			{
				$notice="Thông tin bạn nhập chưa chính xác, đầy đủ $username";
			}
		}
	}
	else
	{
		$notice="Mã xác nhận không đúng, vui lòng đăng ký lại.";
	}
}
function Login()
{	
	global $notice, $database, $database2;
	//include("./config.php");
	include("./includes/config.php");
	$key=substr($_SESSION['key'],0,4);
	$number = $_REQUEST['number_captcha'];
	
	if($number==$key && $number != ''){
	
		$username=CleanSQLInjection($_POST['username']);
		$password=CleanSQLInjection($_POST['password']);
		
		$sql = "Select * from account where id = '$username' and password_hash = '$password'";
		$user = $db->getRow($sql);
		//$notice = $ok;
		//print_r($ok);
		
		if(count($user) == 0)
		{
			$notice = "Sai tài khoản hoặc mật khẩu";
		}
		if(count($user) > 0 and isset($_COOKIE['username']))
		{
			$notice = "Đăng nhập thành công. Vui lòng chọn Server.";
			header('Location: index.php?do=player');
		}
		if(count($user) > 0 and $_COOKIE['username'] == "")
		{
			setcookie("username",$username,time() + 1800);
			setcookie("password",$user['password'],time() + 1800);
			$notice = "Đăng nhập thành công. Vui lòng chọn Server.";			
			$arr['ip_login_last'] = getRealIPAddress();
			$arr['time_login_last'] = date("Y-m-d H:i:s");
			vaUpdate("account", $arr, " id = '".$username."'");
			
			//User Block
			setcookie("useractive",$user['active'],time() + 1800);
			header('Location: index.php?do=player');
		}
	}
	else
	{
		$notice="Mã xác nhận không đúng, vui lòng đăng ký lại.";
	}
}
function Logout(){
	setcookie("username","",time() + 1800);
	setcookie("password","",time() + 1800);
	setcookie("username", "", time()-60*60*24); 
	setcookie("password", "", time()-60*60*24); 
	header('Location:./');
}
function NapThe()
{
	$key=substr($_SESSION['key'],0,4);
	$number = $_REQUEST['number_captcha'];
	//echo $number.'|'.$key;
	if($number==$key && $number != ''){
		
		$provider = $_POST["provider"];
		$cardpin = $_POST["pin"];
		$serial = $_POST["serial"];
		$server = $_POST["server"];
		
		$file1 = "./lib/EbayVNPT/libs/nusoap.php";
		$file2 = "./lib/EbayVNPT/Entries.php";
		//$file3 = "./lib/EbayVNPT/home_.php";
		require_once($file1);	
		include($file2);	
		$webservice = "http://charging-service.megapay.net.vn/CardChargingGW_V2.0/services/Services?wsdl";
			//$webservice = "http://charging-test.megapay.net.vn:10001/CardChargingGW_V2.0/services/Services?wsdl";
			$soapClient = new SoapClient(null, array('location' => $webservice, 'uri' => "http://113.161.78.134/VNPTEPAY/"));
		
		CardCharging($soapClient,$serial,$cardpin,$provider, $server);
	}
	
		
}
function CardCharging($soapClient, $serial, $pin, $serviceProvider, $server)
{
	global $notice, $database, $database2;
	include('config.php');
	//if($CardCharging == null)
	//$CardCharging = new CardCharging();
	
	$server =="s1";
	/*if($server =="s1")
		mysql_select_db($database);
	if($server =="s2")
		mysql_select_db($database2);*/
	$notice = $server;
		
	$m_PartnerID = "lxnam";
	$m_MPIN = "zelukcsp";
	$m_UserName = "lxnam";
	$m_Pass = "ovfzgs";	
	$m_PartnerCode = "00311";		
	$userPlayer = $_COOKIE['username'];
	//Ten tai khoan nguoi dung tren he thong doi tac
	$m_Target = "amgh-".$server."-".$userPlayer.'-'.rand(0,100); 
	//dung de gioi han so lan duyet the, neu member cua doi tac do duyet qua 5 lan thi doi tac do se bi block trong vong 24h
	
	//echo $m_Target;
		
	//$login->login($m_UserName, $m_Pass, $m_PartnerID);
	$CardCharging = new CardCharging();
	$CardCharging->m_UserName = $m_UserName;
	$CardCharging->m_PartnerID = $m_PartnerID;
	$CardCharging->m_MPIN = $m_MPIN;
	$CardCharging->m_Target = $m_Target;
	$CardCharging->m_Card_DATA = $serial.":".$pin.":"."0".":".$serviceProvider;
	$CardCharging->m_SessionID = "";
	$CardCharging->m_Pass  = $m_Pass;
	$CardCharging->soapClient = $soapClient;
	
	$transid = $m_PartnerCode.date("YmdHms");//gen transaction id

	$CardCharging -> m_TransID = $transid;
	//echo "<br/>Transaction id: ".$transid."<br/>";		
	//var_dump($CardCharging);
	//print_r($CardCharging -> m_SessionID);
	$CardChargingResponse = new CardChargingResponse();
	$CardChargingResponse = $CardCharging->CardCharging_();
//	print_r($CardChargingResponse);
	//print_r("Ket qua thuc hien giao dich: ");
	//echo "</br>";
	//print_r("Trang thai giao dich: ".$CardChargingResponse->m_Status);
	//echo "</br>";
	global $error;
	if($CardChargingResponse->m_Status == '1')
	{
		// Successfull
		$money_card = $CardChargingResponse->m_RESPONSEAMOUNT;
		//echo $_COOKIE['username'];			
		$KNB_revice = KMChangeCard($money_card,1.5);
		
		$today = date("Y-m-d H:i:s");    
		$username = $_COOKIE['username'];
		$sql = "
		INSERT INTO `chongzhi` (
		`id` ,
		`userName` ,
		`chrName` ,
		`costmoney` ,
		`golden` ,
		`chongzhichuli` ,
		`chongzhidatatime`
		)
		VALUES (
		NULL , '".$username."', '".$username."', '0', '".$KNB_revice."', '0', '".$today."'
		);
		";
		
		$ok = mysql_query($sql);
		$ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '';
		// log
		$sql = "
		INSERT INTO `userexchange` (
		`userName` ,
		`ma_pin` ,
		`so_the` ,
		`mang` ,
		`money`,
		`ip` 
		)
		VALUES ('".$username."', '".$pin."', '".$serial."', '".$serviceProvider."', '".$money_card."', '".$ip."'
		);
		";
		$ok = mysql_query($sql);
		$notice = "Bạn đã nạp thẻ ".number_format($money_card) . " thành công.";
		//header('Location: nap-the.php');
	}
	else
	{			
		//echo ResultChargingVNPT($CardChargingResponse->m_Status);
		$notice = "Bạn đã nạp thẻ thất bại. Lỗi giao dịch [ ".ResultChargingVNPT($CardChargingResponse->m_Status)." ]. Vui lòng thử lại";
		//header('Location: nap-the.php');
	}
	//print_r("Menh gia tra ve: ".$CardChargingResponse->m_RESPONSEAMOUNT);
	//echo "</br>";
	//print_r("Transaction id: ".$CardChargingResponse->m_TRANSID);
	//echo "<br/>----------------Ket thuc charging-----------------------<br/>";							
}
function SendEmail()
{
	include("./includes/config.php");
	include('./lib/PHPMailer/class.phpmailer.php');
	include('./class/email.class.php');
	global $notice, $database, $database2, $arr, $db;
	global $mail, $lg;
	$mail = new PHPMailer();	
	$mail->IsSMTP();
	
	//// if you're using SSL
//	$mail->SMTPSecure = 'ssl';
//	// OR use TLS
//	$mail->SMTPSecure = 'tls';
//	
//	$mail->SMTPDebug = 1;
//	$mail->Mailer = "smtp";
//	$mail->Host = "mail.aomonggiangho.com";
//	$mail->Port = 587;
//	$mail->SMTPAuth = true;
//	$mail->Username = "info@aomonggiangho.com";
//	$mail->Password = "12345qwert";
//	
//	$mail->From     = "info@aomonggiangho.com";
//	$mail->AddAddress("kamnhattuan@gmail.com"); 
	
	//Gmail
	//Complete
	$mail->SMTPDebug = 0;  // debugging: 1 = errors and messages, 2 = messages only
	$mail->SMTPAuth = true;  // authentication enabled
	$mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail
	$mail->Host = 'smtp.gmail.com';
	$mail->Port = 465; 
	$mail->From     = "giftcode.aomonggiangho@gmail.com";
	$mail->Username   = "giftcode.aomonggiangho@gmail.com";
	$mail->Password   = "kamnhattuan";
	
	$mail->Subject  = "GiftCode Ảo Mộng Giang Hồ";
	$mail->Body     = "Hi!";
	
	$mail->SetFrom("GiftCode Ảo Mộng Giang Hồ");
	$mail->CharSet = "UTF-8"; 
		
	$mail_subject = "[Ảo Mộng Giang Hồ] - Gift Code".date("d-m-Y");
	$mail_content = $_COOKIE['username'];
	
	$sql = "select *from player where `userName` = '". "fWbaQqw6PUfXjA7Y"."'";
	$user = $db->getRow($sql);
	$mail_to = "kamnhattuan@gmail.com";
	//$mail_bcc = CST_ADMIN_EMAIL;
	
	$mail->Subject = $mail_subject;
	//$mail_to = $emails[$i];
	$mail->AddAddress($mail_to, $mail_to);
	$mail->MsgHTML($mail_to);
	if(!$mail->Send()) {
	$notice =  "Mailer Error: " . $mail->ErrorInfo;
	} else {
	$notice = "Đã gửi email";
	}
	
	$mail->Send();
	/*
	//$mail->MsgHTML($mail_content);

	
	
	//$filePath = "./files/ketoan.xls";
	//$fileName = "ketoan.xls";
	//$mail->AddAttachment($filePath, $fileName);
	
	//$ds = PostClean('ds_email');
	
	//$emails = explode(";", $ds);	
	//for($i = 0; $i < count($emails); $i++)	
	//{
	//	$mail_to = $emails[$i];
	//	$mail->AddAddress($mail_to, $mail_to);
	//	$mail->MsgHTML($mail_to);
	//	$mail->Send();	
	//}	
	*/
}

function Test()
{
	include("./includes/config.php");	
	global $notice, $database, $database2, $db, $arr;	
	
	//$db->db_select_db("daokiemvotinh2") || die("Could not connect to SQL db");
	//$sql="INSERT INTO `daokiemvotinh`.`userprops` (`id`, `backpack`, `baseId`, `count`, `positionId`, `quality`, `binding`, `discardTime`, `expiration`, `playerId`) VALUES (NULL, '1', '31007', '99', '29', '3', '0', NULL, NULL, '20280');";	
	/*$sql = "INSERT INTO `userprops` (`id`, `backpack`, `baseId`, `count`, `positionId`, `quality`, `binding`, `discardTime`, `expiration`, `playerId`) VALUES (NULL, '1', '30021
', '20', '5', '0', '0', NULL, NULL, '2487');";
	$db->getRow($sql);*/
	/*$sql = "INSERT INTO `userequip` (
`id` ,
`backpack` ,
`baseId` ,
`count` ,
`positionId` ,
`quality` ,
`additionAttributes` ,
`attributes` ,
`binding` ,
`currentEndure` ,
`currentMaxEndure` ,
`discardTime` ,
`expiration` ,
`holeAttributes` ,
`playerId` ,
`starLevel` ,
`shenwuTempo` ,
`shenwuSwitch`
)
VALUES (
NULL , '1', '401406', '1', '47', '4', NULL , '1_1103_762', '0', '600', '600', NULL , NULL , '5_-1|2_-1|1_-1|3_-1|4_-1', '20282', '6', '0', '1_1_20|2_1_40|3_0_32|'
)";
	
	$db->getRow($sql);*/
	//Cuong hoa phu 8
	$sql = "INSERT INTO `userprops` (`id`, `backpack`, `baseId`, `count`, `positionId`, `quality`, `binding`, `discardTime`, `expiration`, `playerId`) VALUES (NULL, '1', '20405', '99', '11', '0', '0', NULL, NULL, '4010');";
	$db->getRow($sql);
	//Cuong hoa phu 8
	$sql = "INSERT INTO `userprops` (`id`, `backpack`, `baseId`, `count`, `positionId`, `quality`, `binding`, `discardTime`, `expiration`, `playerId`) VALUES (NULL, '1', '30035', '99', '10', '0', '0', NULL, NULL, '4010');";
	$db->getRow($sql);
	//Cuong hoa phu 7
	$sql = "INSERT INTO `userprops` (`id`, `backpack`, `baseId`, `count`, `positionId`, `quality`, `binding`, `discardTime`, `expiration`, `playerId`) VALUES (NULL, '1', '30034', '99', '9', '0', '0', NULL, NULL, '4010');";
	$db->getRow($sql);
	
	//Cuong hoa phu 7
	$sql = "INSERT INTO `userprops` (`id`, `backpack`, `baseId`, `count`, `positionId`, `quality`, `binding`, `discardTime`, `expiration`, `playerId`) VALUES (NULL, '1', '30034', '99', '8', '0', '0', NULL, NULL, '4010');";
	$db->getRow($sql);
	
	//Cuong hoa phu 8
	$sql = "INSERT INTO `userprops` (`id`, `backpack`, `baseId`, `count`, `positionId`, `quality`, `binding`, `discardTime`, `expiration`, `playerId`) VALUES (NULL, '1', '30035', '99', '7', '0', '0', NULL, NULL, '4010');";
	$db->getRow($sql);
	//Cuong hoa phu 8
	$sql = "INSERT INTO `userprops` (`id`, `backpack`, `baseId`, `count`, `positionId`, `quality`, `binding`, `discardTime`, `expiration`, `playerId`) VALUES (NULL, '1', '30036', '99', '6', '0', '0', NULL, NULL, '4010');";
	$db->getRow($sql);
	//Cuong hoa phu 8
	$sql = "INSERT INTO `userprops` (`id`, `backpack`, `baseId`, `count`, `positionId`, `quality`, `binding`, `discardTime`, `expiration`, `playerId`) VALUES (NULL, '1', '30037', '99', '5', '0', '0', NULL, NULL, '4010');";
	$db->getRow($sql);
	
	//Cuong hoa phu 8
	$sql = "INSERT INTO `userprops` (`id`, `backpack`, `baseId`, `count`, `positionId`, `quality`, `binding`, `discardTime`, `expiration`, `playerId`) VALUES (NULL, '1', '30011', '99', '4', '0', '0', NULL, NULL, '4010');";
	$db->getRow($sql);
	
	//Cuong hoa phu 8
	$sql = "INSERT INTO `userprops` (`id`, `backpack`, `baseId`, `count`, `positionId`, `quality`, `binding`, `discardTime`, `expiration`, `playerId`) VALUES (NULL, '1', '10016', '99', '2', '0', '0', NULL, NULL, '4010');";
	$db->getRow($sql);
	
	/*
	//Kim su vuong dan
	$sql = "INSERT INTO `userprops` (`id`, `backpack`, `baseId`, `count`, `positionId`, `quality`, `binding`, `discardTime`, `expiration`, `playerId`) VALUES (NULL, '1', '30013', '99', '6', '0', '0', NULL, NULL, '4010');";
	$db->getRow($sql);
	
	//Kim su vuong dan
	$sql = "INSERT INTO `userprops` (`id`, `backpack`, `baseId`, `count`, `positionId`, `quality`, `binding`, `discardTime`, `expiration`, `playerId`) VALUES (NULL, '1', '30014', '99', '5', '0', '0', NULL, NULL, '4010');";
	$db->getRow($sql);
	
	//Kim su vuong dan
	$sql = "INSERT INTO `userprops` (`id`, `backpack`, `baseId`, `count`, `positionId`, `quality`, `binding`, `discardTime`, `expiration`, `playerId`) VALUES (NULL, '1', '21005', '99', '4', '0', '0', NULL, NULL, '4010');";
	$db->getRow($sql);
	
	//Kim su vuong dan
	$sql = "INSERT INTO `userprops` (`id`, `backpack`, `baseId`, `count`, `positionId`, `quality`, `binding`, `discardTime`, `expiration`, `playerId`) VALUES (NULL, '1', '10016', '99', '3', '0', '0', NULL, NULL, '4010');";
	$db->getRow($sql);	
	
	//Kim su vuong dan
	$sql = "INSERT INTO `userprops` (`id`, `backpack`, `baseId`, `count`, `positionId`, `quality`, `binding`, `discardTime`, `expiration`, `playerId`) VALUES (NULL, '1', '10016', '99', '2', '0', '0', NULL, NULL, '4010');";
	$db->getRow($sql);
	//Kim su vuong dan
	$sql = "INSERT INTO `userprops` (`id`, `backpack`, `baseId`, `count`, `positionId`, `quality`, `binding`, `discardTime`, `expiration`, `playerId`) VALUES (NULL, '1', '20905', '99', '1', '0', '0', NULL, NULL, '4010');";
	$db->getRow($sql);*/
	/*
	//Phu ma vang
	$sql = "INSERT INTO `userprops` (`id`, `backpack`, `baseId`, `count`, `positionId`, `quality`, `binding`, `discardTime`, `expiration`, `playerId`) VALUES (NULL, '1', '30021', '20', '1', '0', '1', NULL, NULL, '660');";
	$db->getRow($sql);
	
	//Chien dau co nu
	$sql = "INSERT INTO `userprops` (`id`, `backpack`, `baseId`, `count`, `positionId`, `quality`, `binding`, `discardTime`, `expiration`, `playerId`) VALUES (NULL, '1', '514411', '1', '2', '0', '1', NULL, NULL, '660');";
	$db->getRow($sql);
	
	//Cuong hoa phu 8
	$sql = "INSERT INTO `userprops` (`id`, `backpack`, `baseId`, `count`, `positionId`, `quality`, `binding`, `discardTime`, `expiration`, `playerId`) VALUES (NULL, '1', '30008', '5', '3', '0', '1', NULL, NULL, '660');";
	$db->getRow($sql);
	//Cuong hoa phu 7
	$sql = "INSERT INTO `userprops` (`id`, `backpack`, `baseId`, `count`, `positionId`, `quality`, `binding`, `discardTime`, `expiration`, `playerId`) VALUES (NULL, '1', '30007', '3', '6', '0', '1', NULL, NULL, '565');";
	$db->getRow($sql);
	
	//Thiet giap ho dan
	$sql = "INSERT INTO `userprops` (`id`, `backpack`, `baseId`, `count`, `positionId`, `quality`, `binding`, `discardTime`, `expiration`, `playerId`) VALUES (NULL, '1', '120014', '5', '4', '0', '1', NULL, NULL, '660');";
	$db->getRow($sql);*/
	/*
	$sql = "INSERT INTO `userprops` (`id`, `backpack`, `baseId`, `count`, `positionId`, `quality`, `binding`, `discardTime`, `expiration`, `playerId`) VALUES (NULL, '1', '10016', '99', '3', '0', '0', NULL, NULL, '20280');";
	$db->getRow($sql);*/
	
}
?>
